<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul{
            width: 400px;
            margin: 0 auto;
            margin-top: 100px;
        }
        li{
            width: 400px;
            height: 50px;
            background-color: aqua;
            text-align: center;
            font-size: 20px;
            margin-top: 11px;
            list-style: none;
        }
    </style>
</head>
<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    
</body>
</html>
<script>
    function ges(el){ return [...document.querySelectorAll(el)]}
    const list = ges("ul li")
    for(let i=0; i<list.length; i++){
        list[i].onclick = function(){
            list[i].innerHTML = i
        }
    }
    /*
        
    */
</script>